package com.dz.controller.common;

import com.dz.result.Result;
import com.dz.service.UploadService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;


/**
 * @author 鄧浩奇
 * @classname UploadController
 * @description
 * @since 2023/12/23 21:52
 **/
@Api(tags = "文件上传")
@RestController
@RequestMapping("/admin/common")
public class UploadController {

    @Resource
    private UploadService uploadService;

    @ApiOperation("上传文件")
    @PostMapping("/upload")
    public Result<String> upload(@RequestBody MultipartFile file) {
        return uploadService.upload(file);
    }


}
